package cn.dz.cycle.loop;

/**
 * @ClassName LoopTest
 * @package: cn.dz.cycle.loop
 * @Description 三种循环的区别
 * @Author dz
 * @Date 2025/2/13 19:03
 * @Version 1.0
 **/
public class LoopTest {
    public static void main(String[] args) {
        //for循环
        for (int i = 1; i <= 3; i++) {
            System.out.println("我爱Java1");
        }
        System.out.println("--------");

        //while循环
        int j = 1;
        while(j <= 3) {
            System.out.println("我爱Java2");
            j++;
        }
        System.out.println("--------");
        //do-while循环
        int k = 1;
        do {
            System.out.println("我爱Java3");
            k++;
        } while (k <= 3);
    }
}
